import request from '@/utils/request'

// 查询预警列表
export function listForewarning(query) {
  return request({
    url: '/storage/forewarning/list',
    method: 'get',
    params: query
  })
}

// 查询预警详细
export function getForewarning(id) {
  return request({
    url: '/storage/forewarning/' + id,
    method: 'get'
  })
}

// 新增预警
export function addForewarning(data) {
  return request({
    url: '/storage/forewarning',
    method: 'post',
    data: data
  })
}

// 修改预警
export function updateForewarning(data) {
  return request({
    url: '/storage/forewarning',
    method: 'put',
    data: data
  })
}

// 采购
export function addRequire(data) {
  return request({
    url: '/storage/require/addRequire',
    method: 'post',
    data: data
  })
}

// 删除预警
export function delForewarning(id) {
  return request({
    url: '/storage/forewarning/' + id,
    method: 'delete'
  })
}
